/**
 * @name Facebox Dandomain
 * @version: 1.0.0 (21/04/2010)
 * @requires jQuery v1.2 and facebox 1.2 (http://famspam.com/facebox/)
 * @author Joachim Loevgaard (www.loevgaard.dk)
 * 
 * Licensed under the MIT:
 *   http://www.opensource.org/licenses/mit-license.php
 */

function FaceboxDandomain() {
	this._layouts = new Array();
}
FaceboxDandomain.prototype.addLayout = function(layout) {
	this._layouts.push(layout);
}
FaceboxDandomain.prototype.addLayouts = function(layouts) {
	for(var i in layouts) {
		this.addLayout(layouts[i]);
	}
}
FaceboxDandomain.prototype.alert = function(str) {
	for (var i in this._layouts) {
		if (!this._layouts[i].trigger || eval(this._layouts[i].trigger)) {
			$.facebox.settings.faceboxHtml = this._layouts[i].html;
			break;
		}
	}
	$.facebox(str);
}
var faceboxDandomain = new FaceboxDandomain();

window.alert = function(str) {
	faceboxDandomain.alert(str);
}